# This program will deserialize the file
# myIndex.dat and attempt to recreate the tree.

from binaryTree import *
import pickle

if __name__ == "__main__":
    serializedFile = open('myIndex.dat', 'r')
    BTree = CBOrdTree()
    root = pickle.load(serializedFile)
    
    BTree.printTree(root)
    print
    BTree.printRevTree(root)
    print
    data = int(raw_input("insert a value to find: "))
    if BTree.lookup(root, data):
        print "found"
    else:
        print "not found"
        
    print BTree.minValue(root)
    print BTree.maxDepth(root)
    print BTree.size(root)
    
    serializedFile.close()